package com.serwis.app.entities;
// default package
// Generated 2014-07-29 18:57:10 by Hibernate Tools 3.4.0.CR1

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name="T_DELIVERER")
public class Deliverer implements java.io.Serializable {

	private static final long serialVersionUID = 1L;
	private int delivererId;
	private String name;
	private String street;
	private String localNumber;
	private String zipCode;
	private String city;
	private String phone;
	private String email;
	private String nip;
	private Set<Product> products = new HashSet<Product>(0);
	private Set<DelivererOrder> delivererOrders = new HashSet<DelivererOrder>(0);

	public Deliverer() {
	}

	public Deliverer(String name, String street, String localNumber, String zipCode,
			String city, String phone, String email, String nip) {
		this.name = name;
		this.street = street;
		this.localNumber = localNumber;
		this.zipCode = zipCode;
		this.city = city;
		this.phone = phone;
		this.email = email;
		this.nip = nip;
	}

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name="DELIVERER_ID",unique = true, nullable = false)
	public int getDelivererId() {
		return delivererId;
	}

	public void setDelivererId(int delivererId) {
		this.delivererId = delivererId;
	}
	
	@Column(name="NAME", nullable=false)
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name="STREET", nullable=false)
	public String getStreet() {
		return street;
	}

	public void setStreet(String street) {
		this.street = street;
	}

	@Column(name="LOCAL_NUMBER", nullable=false)
	public String getLocalNumber() {
		return localNumber;
	}

	public void setLocalNumber(String localNumber) {
		this.localNumber = localNumber;
	}

	@Column(name="ZIP_CODE", nullable=false)
	public String getZipCode() {
		return zipCode;
	}

	public void setZipCode(String zipCode) {
		this.zipCode = zipCode;
	}

	@Column(name="CITY", nullable=false)
	public String getCity() {
		return city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	@Column(name="PHONE", nullable=false)
	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	@Column(name="EMAIL", nullable=false)
	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	@Column(name="NIP", nullable=false)
	public String getNip() {
		return nip;
	}

	public void setNip(String nip) {
		this.nip = nip;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "deliverer", cascade = CascadeType.ALL)
	public Set<Product> getProducts() {
		return products;
	}

	public void setProducts(Set<Product> products) {
		this.products = products;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "deliverer", cascade = CascadeType.ALL)
	public Set<DelivererOrder> getDelivererOrders() {
		return delivererOrders;
	}

	public void setDelivererOrders(Set<DelivererOrder> delivererOrders) {
		this.delivererOrders = delivererOrders;
	}

	


}
